package com.itheima_32;

import java.text.ParseException;
import java.util.Date;

public class DateUtilsDemo {
    public static void main(String[] args) throws ParseException {
        Date d1 = new Date();
        String s1 = DateUtils.dateToString(d1, "yyyy-MM-dd");
        System.out.println(s1);

        String d2 = "2020-11-11";
        Date s2 = DateUtils.stringToDate(d2, "yyyy-MM-dd");
        System.out.println(s2);

    }
}
